#!/bin/sh
#This script used for stop openvpn-client for linux system
#Written by Wesley,Zhang  2017/09/15 

#PID=`ps -ef |grep openvpn |grep -v grep |cut -c 9-15`
PID=`ps -ef |grep '/etc/openvpn/client/bonc_shanxi.ovpn' |grep -v grep |cut -c 9-20`

if [ -z $PID ]; then
    echo "Openvpn已停止运行。"
else
    kill -9 $PID
    echo "正在结束openvpn进程。"
fi
